#!/usr/bin/python
# -*- coding: utf-8 -*-

class Plugin():
    def name(self):
	return "mplayer"

    def check(self):
	    p = Popen(["ps","-eo","pcpu,comm"],stdout=PIPE)
	    p.wait()
	    line = True
	    while (line):
		line = p.stdout.readline()
		s = line.strip()
		if (not s):
		    continue
		
		s = line.strip().split(' ')
		if s[1] == "mplayer":
		    if float(s[0]) > 2:
			return "mplayer playing something"
